//路由跳转的权限校验
const express = require('express');
const route = express.Router();
const {
    jwtDecode
} = require('../utils/token')
//引入权限中间件
const isLoginMiddle = require('../middleware/isLoginMiddle');
const advModel = require('../db/model/advModel');
//主要是为了书写一个接口,使用我们封装好的权限验证中间件
route.get("/getUpdateData", isLoginMiddle, async (req, res) => {
    const {
        _id
    } = req.query;
    try {
        const findResult = await advModel.findOne({
            _id
        })
        console.log(findResult);
        res.send({
            code: 10000,
            msg: "更新数据钱查询当前数据成功",
            data: findResult
        })
    } catch (e) {
        res.send({
            code: 10000,
            msg: "更新数据钱查询当前数据失败"+e.message,
            data: null
        })
    }
})
module.exports = route